package com.itkjb.leisurely.resource.sys.model.vo;

import com.baomidou.mybatisplus.annotation.TableField;
import com.itkjb.leisurely.core.util.StringToStartUtil;
import com.itkjb.leisurely.resource.sys.model.SysUserModel;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import org.apache.commons.lang3.StringUtils;

/**
 * Copyright (C), 2018-2020
 * 用户信息展示层，为了避免 查询的关键数据流程
 * @Author: lix
 * @Date: 2020-08-07 17:51
 * @Description:
 * @Version: V1.0.0
 */
@ApiModel(value="SysUserVo-展示层", description="系统用户")
public class SysUserVO extends SysUserModel {
    /**
     * 手机号
     */
    @ApiModelProperty(value = "手机号")
    @TableField("`mobile`")
    private String mobile;

    @Override
    public String getMobile() {
        if(StringUtils.isNotBlank(super.getMobile())){
            return StringToStartUtil.strCoverForPrivacy(super.getMobile());
        }else{
            return super.getMobile();
        }
    }


}
